package il.ac.braude.sona.ocsf;

import il.ac.braude.sona.database.User;

import java.io.Serializable;
import java.util.ArrayList;

public class Mssg implements Serializable {	
	private static long idProvider;
	private long id;
	private String type;
	private Object mssg;
	public Mssg(Long id, String type, Object mssg) {
		this.id=id;
		this.mssg=mssg;
		this.type=type;
	}
	public Mssg(String type) {
		id=idProvider++;
		this.type=type;
	}
	public Mssg(String type, Object mssg) {
		id=idProvider++;
		this.type=type;
		this.mssg=mssg;
	}
	public Long getID() {
		return id;
	}
	public void setID(long id) {
		this.id=id;
	}
	public void setMessege(Object mssg) {
		this.mssg=mssg;
	}
	public Object getMessege() {
		return mssg;
		
	}
	@Override
	public boolean equals(Object obj) {
		if (obj.toString().startsWith(type)) return true;
		return super.equals(obj);
	}
}
